package com.taobao.api.request;

import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;
import java.util.HashMap;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.FileItem;
import com.taobao.api.TaobaoUploadRequest;
import com.taobao.api.internal.util.TaobaoHashMap;

import com.taobao.api.response.TmallExchangeMessageAddResponse;

/**
 * TOP API: tmall.exchange.message.add request
 * 
 * @author top auto create
 * @since 1.0, 2018.08.09
 */
public class TmallExchangeMessageAddRequest extends BaseTaobaoRequest<TmallExchangeMessageAddResponse> implements TaobaoUploadRequest<TmallExchangeMessageAddResponse> {

	
	

	/** 
	* 留言内容
	 */
	private String content;

	/** 
	* 换货单号ID
	 */
	private Long disputeId;

	/** 
	* 返回字段。目前支持id,refund_id,owner_id,owner_nick,owner_role,content,pic_urls,created,message_type
	 */
	private String fields;

	/** 
	* 凭证图片列表
	 */
	private FileItem messagePics;

	public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
		return this.content;
	}

	public void setDisputeId(Long disputeId) {
		this.disputeId = disputeId;
	}

	public Long getDisputeId() {
		return this.disputeId;
	}

	public void setFields(String fields) {
		this.fields = fields;
	}

	public String getFields() {
		return this.fields;
	}

	public void setMessagePics(FileItem messagePics) {
		this.messagePics = messagePics;
	}

	public FileItem getMessagePics() {
		return this.messagePics;
	}

	public String getApiMethodName() {
		return "tmall.exchange.message.add";
	}

	public Map<String, String> getTextParams() {
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("content", this.content);
		txtParams.put("dispute_id", this.disputeId);
		txtParams.put("fields", this.fields);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<TmallExchangeMessageAddResponse> getResponseClass() {
		return TmallExchangeMessageAddResponse.class;
	}

	public void check() throws ApiRuleException {
		
		RequestCheckUtils.checkNotEmpty(content, "content");
		RequestCheckUtils.checkNotEmpty(disputeId, "disputeId");
		RequestCheckUtils.checkNotEmpty(fields, "fields");
		RequestCheckUtils.checkMaxListSize(fields, 20, "fields");
	}

	public Map<String, FileItem> getFileParams() {
		Map<String, FileItem> params = new HashMap<String, FileItem>();
		params.put("message_pics", this.messagePics);
		return params;
	}
	
	

}